home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / User1_12.pxl < prev    next >
Text File  |  2000-12-23  |  5KB  |  176 lines

  1. {    Filename    :     user1_12.pxl
  2.      Purpose    :    <Skeleton file for PiXCL applications>
  3.     Date        :    <date>
  4.     Author        :    <author>
  5. History:
  6.  
  7.     Version    :      5.00    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "PiXCL Skeleton Application"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,100,200,588,420,Res)                
  24.     UseBackground(TRANSPARENT,255,255,255)     
  25.     WinShow(Title$,NOTOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     SysCmdEndAt(Terminate)
  30.  
  31.     {DragAcceptFile(ENABLE,AcceptFile)}
  32.     {AutoProgressBar(DISABLE)}
  33.  
  34.     InfoMenu(REMOVE)
  35.     WaitInput(100)
  36.     SetMenu("&File",IGNORE,
  37.         "&New",CreatingFile,
  38.         "&Open",OpeningFile,
  39.         "&Save",SavingFile,
  40.         "Save &All",SavingAllFiles,
  41.         SEPARATOR,
  42.         "E&xit!",Terminate,
  43.         ENDPOPUP,
  44.         {"&View",IGNORE,
  45.         "&ToolBar",ViewToolBar,
  46.         "&StatusBar",ViewStatusBar,
  47.         ENDPOPUP, }
  48.         "&Information",IGNORE,
  49.         "&Concept",Concept,
  50.         "&Help",ShowAppHelp,
  51.         SEPARATOR,
  52.         "&About",About,
  53.         ENDPOPUP)
  54.  
  55.     {GoSub MakeToolbar
  56.     ChangeMenuItem("&ToolBar",CHECK,TBRes) }
  57.  
  58.         
  59.     {StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  60.     DrawStatusWinText(0,"Ready")
  61.     ChangeMenuItem("&StatusBar",CHECK,SBRes)  }
  62.  
  63.         
  64.  
  65.     
  66. Wait_for_Input:
  67.     WaitInput()
  68.  
  69. Terminate:
  70.     { Put in any special commands here that have to executed when the app exits.}
  71.  
  72.     End
  73.  
  74.  
  75. Concept:
  76.     MessageBox(OK,1,INFORMATION,
  77. "This is a skeleton of a PiXCL application.  You could briefly
  78. describe your application's function here, or provide some
  79. basic help information.",
  80.     "PiXCL Skeleton Concept",Res)
  81.  
  82.     Goto Wait_for_Input
  83.  
  84. ShowAppHelp:
  85.     {An application Help file usually has the same name as the application.}
  86.     Winhelp("MyApp.hlp",CONTENTS,"")
  87.  
  88.     Goto Wait_for_Input
  89.  
  90. About:
  91.     AboutUser("User Application Title goes here",  { or substitute Title$}
  92.       "Two lines of text goes here e.g. Application function.",
  93.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  94.  
  95.     Goto Wait_for_Input
  96.  
  97. ViewToolBar:
  98.     GetMenuStatus("&ToolBar",CHECKED,Res)
  99.     If Res = 0
  100.         GoSub MakeToolbar
  101.         ChangeMenuItem("&ToolBar",CHECK,Res)
  102.     Else
  103.         Toolbar()
  104.         ChangeMenuItem("&ToolBar",UNCHECK,Res)
  105.     Endif
  106.     Goto Wait_for_Input
  107.  
  108. ViewStatusBar:
  109.     GetMenuStatus("&StatusBar",CHECKED, Res)
  110.     If Res = 0
  111.         StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  112.         DrawStatusWinText(0,"Ready")
  113.         ChangeMenuItem("&StatusBar",CHECK,Res)
  114.     Else
  115.         StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
  116.        ChangeMenuItem("&StatusBar",UNCHECK,Res)
  117.     Endif
  118.     Goto Wait_for_Input
  119.  
  120. CreatingFile:
  121.     WaitInput(1)
  122.     {TODO: add file handling here}
  123.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  124.                     "Creating File",Res)
  125.     Goto Wait_for_Input
  126.  
  127. OpeningFile:
  128.     WaitInput(1)
  129.     {TODO: add file handling here}
  130.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  131.                     "Opening File",Res)
  132.     Goto Wait_for_Input
  133.  
  134. SavingFile:
  135.     WaitInput(1)
  136.     {TODO: add file handling here}
  137.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  138.                     "Saving File",Res)
  139.     Goto Wait_for_Input
  140.  
  141. SavingAllFiles:
  142.     WaitInput(1)
  143.     {TODO: add file handling here}
  144.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  145.                     "Saving All Files",Res)
  146.     Goto Wait_for_Input
  147.  
  148.  
  149. PrintingFile:
  150.     WaitInput(1)
  151.     {TODO: add file handling here}
  152.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  153.                     "Printing File",Res)
  154.     Goto Wait_for_Input
  155.  
  156. AcceptFile:
  157.     GetDragList(FileList$)
  158.     {TODO: add file list handling here, or delete this whole label handler}
  159.     Goto Wait_for_Input
  160.     
  161. {--- Style Suggestion: place all subroutines at the end of the script.}
  162.  
  163. MakeToolbar: {subroutine}
  164.     Toolbar(RAISED, PXL_SMALL,
  165.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  166.         PXL_NEW, ENABLED, STD, "FileNew", CreatingFile,
  167.         PXL_OPEN, ENABLED, STD, "FileOpen", OpeningFile, 
  168.         PXL_SAVE, ENABLED, STD, "FileSave", SavingFile, 
  169.         SAVEALL,  ENABLED, STD,"Save All", SavingAllFiles,
  170.         PXL_PRINT,  ENABLED, STD,"PrintFile", PrintingFile, 
  171.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  172.         HELPINFO, ENABLED, STD,"Show Help",ShowAppHelp) 
  173.  
  174.     Return
  175.  
  176.